/*
 * Copyright (C) 2001-2008  Nishanth Menon <menon.nishanth at gmail dot com>
 *
 * Part of the predict two project done during NITC Final year.
 * Predict2: http://code.google.com/p/predict2/
 * NITC: http://web.nitc.ac.in/~cse/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  US
 */


/*
 * ModeSelector.java
 *
 * Created on September 25, 2001, 6:05 AM
 */
package GUI;


/**
 * This Selects whether the User works as a Merchant or a Citizen
 * So In short We have a nice Stupid looking Dialog!!! With a Dummy!!!
 * @author  lazarus
 * @version 1.01
 */
public class ModeSelector extends javax.swing.JDialog
{

    /** Creates new form ModeSelector */
    public ModeSelector (java.awt.Frame parent, boolean modal)
    {
        super (parent, modal);
        initComponents ();
        pack ();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the FormEditor.
     */
    private void initComponents ()
    {                           // GEN-BEGIN:initComponents
        // setResizable (false);
        BasePanel = new java.awt.Panel ();
        MerchantButton = new javax.swing.JButton ();
        CitizenButton = new javax.swing.JButton ();
        jScrollPane5 = new javax.swing.JScrollPane ();
        MerchantInfoData = new javax.swing.JTextArea ();
        QuitButton = new javax.swing.JButton ();
        jScrollPane6 = new javax.swing.JScrollPane ();
        CitizenDataInfo = new javax.swing.JTextArea ();
        getContentPane ().setLayout (null);
        setTitle ("Select Whether to Recieve or Send Money");
        addWindowListener (new java.awt.event.WindowAdapter ()
                           {
                           public void windowClosing (java.awt.event.WindowEvent evt)
                           {
                           closeDialog (evt);}
                           }
        );

        BasePanel.setLayout (null);
        BasePanel.setFont (new java.awt.Font ("Dialog", 0, 11));
        BasePanel.setName ("BasePanel");
        BasePanel.setBackground (java.awt.Color.black);
        BasePanel.setForeground (java.awt.Color.white);

        MerchantButton.
            setToolTipText ("Click Here If U wish to Recieve Money From a Specific Citizen");
        MerchantButton.setBorder (new javax.swing.border.SoftBevelBorder (0));
        MerchantButton.setForeground (java.awt.Color.white);
        MerchantButton.setActionCommand ("Merchant");
        MerchantButton.setFont (new java.awt.Font ("TimesNewRoman", 1, 14));
        MerchantButton.setText ("Merchant");
        MerchantButton.setBackground (java.awt.Color.darkGray);
        MerchantButton.addMouseListener (new java.awt.event.MouseAdapter ()
                                         {
                                         public void mouseClicked (java.awt.event.
                                                                   MouseEvent evt)
                                         {
                                         MerchantButtonMouseClicked (evt);}
                                         }
        );
        BasePanel.add (MerchantButton);
        MerchantButton.setBounds (40, 330, 190, 40);


        CitizenButton.
            setToolTipText ("Click Here If U wish to Give Money to a specific Merchant");
        CitizenButton.setBorder (new javax.swing.border.SoftBevelBorder (0));
        CitizenButton.setForeground (java.awt.Color.white);
        CitizenButton.setActionCommand ("Citizen");
        CitizenButton.setFont (new java.awt.Font ("TimesNewRoman", 1, 14));
        CitizenButton.setText ("Citizen");
        CitizenButton.setBackground (java.awt.Color.darkGray);
        CitizenButton.addMouseListener (new java.awt.event.MouseAdapter ()
                                        {
                                        public void mouseClicked (java.awt.event.
                                                                  MouseEvent evt)
                                        {
                                        CitizenButtonMouseClicked (evt);}
                                        }
        );
        BasePanel.add (CitizenButton);
        CitizenButton.setBounds (500, 330, 170, 40);



        MerchantInfoData.setWrapStyleWord (true);
        MerchantInfoData.setLineWrap (true);
        MerchantInfoData.setBorder (new javax.swing.border.SoftBevelBorder (0));
        MerchantInfoData.setEditable (false);
        MerchantInfoData.setCaretColor (java.awt.Color.red);
        MerchantInfoData.setForeground (java.awt.Color.cyan);
        MerchantInfoData.setFont (new java.awt.Font ("TimesNewRoman", 0, 12));
        MerchantInfoData.
            setText
            ("\nMode: MERCHANT\n\nGist: U Wish to take the Money from some person - a Citizen\n\nIn Detail:\n\n   So U are the nice Guy who is owed some money by some other guy. So what do U do ? U click this button and answer some simple questions.\n\n   And then - Booom His Money is in Ur Account.\n\n   Of Course U need to have an Account with Ur Zone Server, And U need to know the IP of the Person from whom U wish to take the money.\n   Yeah, And Finally, He Should also be running the Software in a citizen mode!!\n\n\n\nCiao\nNishanth 'Lazarus' Menon\n\nSeptember 2001");
        MerchantInfoData.setBackground (new java.awt.Color (69, 77, 75));
        jScrollPane5.setViewportView (MerchantInfoData);

        BasePanel.add (jScrollPane5);
        jScrollPane5.setBounds (40, 10, 300, 270);


        QuitButton.setToolTipText ("Click This If U wish to Get The Hell out of Here");
        QuitButton.setLabel ("Quit");
        QuitButton.setBorder (new javax.swing.border.BevelBorder (0));
        QuitButton.setForeground (java.awt.Color.lightGray);
        QuitButton.setFont (new java.awt.Font ("TimesNewRoman", 1, 14));
        QuitButton.setBackground (java.awt.Color.darkGray);
        QuitButton.addMouseListener (new java.awt.event.MouseAdapter ()
                                     {
                                     public void mouseClicked (java.awt.event.MouseEvent evt)
                                     {
                                     QuitButtonMouseClicked (evt);}
                                     }
        );
        BasePanel.add (QuitButton);
        QuitButton.setBounds (270, 330, 180, 40);



        CitizenDataInfo.setWrapStyleWord (true);
        CitizenDataInfo.setToolTipText ("This Is About What a Citizen is All About");
        CitizenDataInfo.setLineWrap (true);
        CitizenDataInfo.setBorder (new javax.swing.border.SoftBevelBorder (0));
        CitizenDataInfo.setEditable (false);
        CitizenDataInfo.setCaretColor (java.awt.Color.red);
        CitizenDataInfo.setForeground (java.awt.Color.cyan);
        CitizenDataInfo.setFont (new java.awt.Font ("TimesNewRoman", 0, 12));
        CitizenDataInfo.
            setText
            ("\nMode Name: CITIZEN\n\nGist: \n    U are the nice Philanthrophist who wishes to send Money to Some Person\n\nIn detail:\n    So Suppose U are a Honest Person in this world \nand wish to Give Some money to a Nice person some \nwhere else in this world.\n\nU need to have an Account at Ur Zone Server and have \nthe adeqaute amount of money in Ur account!\n\nThen U click the Citizen button given below and Wait \nfor the merchant - Or the person who wishes to take \nthe money from U contacts U.\n\nThen It is Bingo Boom. Ur Money goes into His Account!\n\n\nCiao,\n\nNishanth 'Lazarus' Menon\n\nSeptember 2001");
        CitizenDataInfo.setBackground (new java.awt.Color (69, 77, 75));
        jScrollPane6.setViewportView (CitizenDataInfo);

        BasePanel.add (jScrollPane6);
        jScrollPane6.setBounds (350, 10, 320, 270);


        getContentPane ().add (BasePanel);
        BasePanel.setBounds (0, 0, 710, 400);

    }                           // GEN-END:initComponents

    private void CitizenButtonMouseClicked (java.awt.event.MouseEvent evt)
    {                           // GEN-FIRST:event_CitizenButtonMouseClicked
        // Add your handling code here:
        System.out.println ("So We Are A Citizen");
        Result = "Citizen";
        closeDialog (null);
    }                           // GEN-LAST:event_CitizenButtonMouseClicked

    private void QuitButtonMouseClicked (java.awt.event.MouseEvent evt)
    {                           // GEN-FIRST:event_QuitButtonMouseClicked
        // Add your handling code here:
        // Sudden Death Dearie... No Questions Asked!
        try
        {
            W_yes_no a = new W_yes_no ("Do You Really Wish to Quit?");

            if (a.getResult ())
                System.exit (1);
        }
        catch (Exception e)
        {
            e.printStackTrace ();
        }
    }                           // GEN-LAST:event_QuitButtonMouseClicked

    private void MerchantButtonMouseClicked (java.awt.event.MouseEvent evt)
    {                           // GEN-FIRST:event_MerchantButtonMouseClicked
        // Add your handling code here:
        System.out.println ("So We Are A Merchant");
        Result = "Merchant";
        closeDialog (null);
    }                           // GEN-LAST:event_MerchantButtonMouseClicked

    /** Closes the dialog */
    private void closeDialog (java.awt.event.WindowEvent evt)
    {                           // GEN-FIRST:event_closeDialog
        setVisible (false);
        dispose ();
    }                           // GEN-LAST:event_closeDialog

    /**
     * @param args the command line arguments
     */
    /* 
     * public static void main (String args[]) { ModeSelector a = new
     * ModeSelector (new javax.swing.JFrame (), true); a.setSize (710, 420);
     * a.setLocation (200, 200); a.show (); } */

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private java.awt.Panel BasePanel;
    private javax.swing.JButton MerchantButton;
    private javax.swing.JButton CitizenButton;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JTextArea MerchantInfoData;
    private javax.swing.JButton QuitButton;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JTextArea CitizenDataInfo;
    public String Result;

    // End of variables declaration//GEN-END:variables

}
